/****************************************************************
*  COPYRIGHT MorningCore CO.,LTD                               *
*****************************************************************/
/****************************************************************
 * FileName:    <ue_tx_rsgen_fix.h>
 * version:     <1.0.0>
 * Purpose:     <Header file of ue_tx_rsgen_fix.c>
 * Authors:     <guohuayong>
 * Notes:       <None>
 ****************************************************************/

/******************************************************************************
*  HISTORY OF CHANGES
*   <Date>          <Author>        <Version>       <DESCRIPTION>
*  2009-06-15      guohuayong        1.0.0            original
******************************************************************************/

#ifndef _ue_tx_rsgen_fix
#define _ue_tx_rsgen_fix

/*-----------including external files -----------------------------*/
//#include "../../common/head/lte_up_extern.h"
#include "../../../../CommLib_FltC/MacroDef.h"
#include "../../../../CommLib_FltC/Typedef.h"
#include "../../../../CommLib_FxpC/Lib_arith_N.h"
#include "../../../../CommLib_FltC/Common_function.h"
#include "../../../../CommLib_FxpC/FFT_Coef_LookUp.h"
#include "NR_UL_macro.h"
#include "stdio.h"
#include "math.h"
//#define _CRT_SECURE_NO_DEPRECATE
/*-----------external variable declaration-------------------------*/

/*-----------constant and type declaration-------------------------*/

/*-----------macro declaration-------------------------------------*/

/*-----------variable declaration-----------------------------------*/

/*-----------Function or task prototype declaration-----------------*/
void RSGen_fix_ReleaseFlag
(
    IN int      UL_RB_Num,                  // number of sub-carriers of RS
    IN int      Ncs,                        // Cyclic shift param in 3GPP TS 38.211
    IN int      Omiga,                      // Omiga in 3GPP TS 38.211
    IN int      Delta,                      // Delta in 3GPP TS 38.211
    IN int      uIdx,                       // u in 3GPP TS 38.211
    IN int      vIdx,                       // v in 3GPP TS 38.211
    IN int      RS_Type,             // alpha = 2*pi*Ncs/12 for 0; alpha = 2*pi*Ncs/8 for 1
    IN char     mul_ncs_flg,         //mul_ncs_flg=0,mean no need multiply ncs
    IN int      N_RotateCoef,
    OUT cmplx_frN   RSGen_Op[]           // output of RSGen
);//added by guobaojuan,20180910

void ZCRootSeqGen_fix
(
	IN int      RootSeqLen,   // 839 or 139 only for PRACH
	IN int      RootSeqParam, // u (PRACH) or q (RS) in 3GPP TS 38.211
	IN int      N_RotateCoef,	
	OUT cmplx_frN	 ZCRootSeqGen_Op[], // Zadoff-Chu root sequence
	IN int      Len30Flag = 0 // 1 - q*(n+1)*(n+2)/31, q = u + 1, 0 - q*n*(n+1)/RootSeqLen
);  // output of RSGen;  // output of RSGen;
///=================================================================================================
/// Nzc_2_8192.
/// mp = mod(m, 2Nzc), n = mod(m_p*4096/Nzc, 8192)
/// @param [in] int m
/// @param [in] int N_zc
/// @par History
///       Date|       Author|        Version|        DESCRIPTION
/// ----------|-------------|---------------|-------------------
/// 2021-09-17|     shanshan|          0.0.1|            created
///=================================================================================================
int Nzc_2_8192(int m, int Nzc);
///=================================================================================================
/// mod_n_N.
/// m = n % N
/// @param [in] int n  
/// @param [in] int N
/// @param [in] int N_zc_Inv_fixp num of 2*Nzc in 2^32
/// @par History
///       Date|       Author|        Version|        DESCRIPTION
/// ----------|-------------|---------------|-------------------
/// 2021-09-17|     shanshan|          0.0.1|            created
///=================================================================================================
int mod_n_N(int n, int N, int N_zc_Inv_fixp);

#endif












